package com.cloud.mall.pms.service;

import com.cloud.mall.api.CommonPage;
import com.cloud.mall.base.BaseResponse;
import com.cloud.mall.pms.dto.PmsProductCategoryParam;
import com.cloud.mall.pms.dto.PmsProductResult;
import com.cloud.mall.pms.dto.product.PmsProductParam;
import com.cloud.mall.pms.dto.product.PmsProductQueryParam;
import com.cloud.mall.pms.input.PmsSkuStockInpDTO;
import com.cloud.mall.pms.out.PmsProductCategoryOut;
import com.cloud.mall.pms.out.PmsProductOut;
import com.cloud.mall.pms.out.PmsSkuStockOut;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@Api(tags = "商品管理")
@RequestMapping("/product")
public interface PmsProductService {


    @ApiOperation("添加产品分类")
    @PostMapping("/create")
    BaseResponse create(@RequestBody PmsProductParam productParam);

    @ApiOperation("更新商品")
    @PostMapping("/update/{id}")
    BaseResponse update(@PathVariable Long id, @RequestBody PmsProductParam productParam);

    @ApiOperation(value = "根据商品id获取商品编辑信息")
    @GetMapping("/updateInfo/{id}")
    BaseResponse<PmsProductResult> getUpdateInfo(@PathVariable Long id);

    @ApiOperation("查询商品")
    @GetMapping("/list")
    BaseResponse<CommonPage<PmsProductOut>> getList(PmsProductQueryParam productQueryParam,
                                                    @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
                                                    @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum);

    @ApiOperation("根据商品名称或货号模糊查询")
    @GetMapping("/simpleList")
    BaseResponse<List<PmsProductOut>> getList(String keyword);

    @ApiOperation("批量修改审核状态")
    @PostMapping("/update/verifyStatus")
    BaseResponse updateVerifyStatus(@RequestParam("ids") List<Long> ids,
                                           @RequestParam("verifyStatus") Integer verifyStatus,
                                           @RequestParam("detail") String detail);

    @ApiOperation("批量推荐商品")
    @PostMapping("/update/recommendStatus")
    BaseResponse updateRecommendStatus(@RequestParam("ids") List<Long> ids,
                                              @RequestParam("recommendStatus") Integer recommendStatus);
    @ApiOperation("批量设为新品")
    @PostMapping("/update/newStatus")
    BaseResponse updateNewStatus(@RequestParam("ids") List<Long> ids,
                                        @RequestParam("newStatus") Integer newStatus);
    @ApiOperation("批量修改删除状态")
    @PostMapping("/update/deleteStatus")
    BaseResponse updateDeleteStatus(@RequestParam("ids") List<Long> ids,
                                           @RequestParam("deleteStatus") Integer deleteStatus);
}
